package com.quan.weixin.service.impl;

import org.springframework.stereotype.Service;

import com.quan.common.core.BaseService;
import com.quan.weixin.entity.WeixinOauthUser;
import com.quan.weixin.service.WeixinOauthUserService;

import tk.mybatis.mapper.entity.Condition;

/**
 * <p>
 * 微信用户表 服务实现类
 * </p>
 *
 * @author 杨浩泉
 * @since 2018-09-28
 */
@Service
public class WeixinOauthUserServiceImpl extends BaseService<WeixinOauthUser> implements WeixinOauthUserService {

	
	@Override
	public WeixinOauthUser findByOpenId(String openid) {
		Condition condition = new Condition(WeixinOauthUser.class) ;
		condition.createCriteria().andEqualTo("openid", openid) ;
		
		return super.selectOne(condition) ;
	}

	@Override
	public WeixinOauthUser findByMobile(String mobile) {
		Condition condition = new Condition(WeixinOauthUser.class) ;
		condition.createCriteria().andEqualTo("mobile", mobile) ;
		
		return super.selectOne(condition) ;
	}
	
}